package com.gotrade.springbootexceptiondemo.common.enums;

/**
 * @author jason.tang
 * @create 2019/4/28
 * @description 错误码
 */
public enum ResultCode {

    /** 成功状态码 */
    SUCCESS("OK", "success"),

    /** 参数错误 */
    PARAM_IS_INVALID("P0001", "parameters are invalid"),

    /** 系统错误 */
    SYSTEM_ERROR("S0000", "System error"),

    USER_DOES_NOT_EXIST("E0001", "User does not exist"),

    USER_ALREADY_EXIST("E0002", "User already exist");

    private String code;
    private String msg;

    ResultCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String code() {
        return this.code;
    }

    public String msg() {
        return this.msg;
    }
}
